#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.66])
AC_INIT([ULS], [1.0], [babel96@gmail.com])
AC_CONFIG_SRCDIR([ulscpp/UlsLex.cpp])
AC_CONFIG_HEADERS([config.h])

AM_INIT_AUTOMAKE([foreign])

# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
AC_PROG_YACC

# Checks for libraries.
AC_CHECK_LIB([pthread], [pthread_mutex_init])

# Checks for header files.
AC_FUNC_ALLOCA
AC_CHECK_HEADERS([fcntl.h libintl.h limits.h locale.h malloc.h stddef.h stdlib.h string.h unistd.h wchar.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_LONG_DOUBLE

AC_CONFIG_MACRO_DIR([m4])

# Checks for library functions.
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([atexit dup2 getcwd memmove memset modf setlocale strcasecmp strchr strdup strrchr strstr strtol strtoul])

AC_PATH_PROG(HELP2MAN, help2man, false)

AC_CONFIG_FILES([Makefile
                 src/Makefile
                 ulscpp/Makefile
                 ulc2class/Makefile
                 ulf_gen/Makefile
                 uls_stream/Makefile
                 man/Makefile
                 tests/Makefile
                 tests/cpp_hello/Makefile
                 tests/dump_toks/Makefile
                 tests/id_stat/Makefile
                 tests/getch/Makefile
                 tests/line/Makefile
                 tests/log/Makefile
                 tests/many_keys/Makefile
                 tests/nest/Makefile
                 tests/strings/Makefile
                 tests/tok_remap/Makefile
                 tests/two_lex/Makefile
                 tests/yacc/Makefile
                 ulc_exam/Makefile])

AC_OUTPUT
